Skip to content

Conversation

@stellaprins
Copy link
Contributor

@stellaprins stellaprins commented Nov 10, 2025

Why is this PR needed?
A demonstration of the Otsu thresholding method not performing robustely on images that do not have bimodal distributions of pixel values would make more sense given the context of the lesson material.

What does this PR do?

  • Swaps around the average pixel intensity of the rectangle with that of the triangle.
  • Updates Figures with the new masks and image with shapes and figure of image histogram
  • Instead of having Figures of all the masks seperately they are presented as one figure with different panels with Thresholding method labels
  • Adds nuance about the Otsu method: "This means it’s only most suitable for images that show two clear peaks in their histogram (also known as a ‘bimodal’ histogram"

Previous mask created by Otsu thresholding

Image

New mask created by Otsu thresholding

Image

New figure mask panels with thresholding labels

image

Linked issues
Resolves #98

How was this PR tested?
I built and checked the documentation locally and checked whether it looked like I expected.

@github-actions
Copy link

github-actions bot commented Nov 10, 2025

Thank you!

Thank you for your pull request 😃

🤖 This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}.

If you have files that automatically render output (e.g. R Markdown), then you should check for the following:

  • 🎯 correct output
  • 🖼️ correct figures
  • ❓ new warnings
  • ‼️ new errors

Rendered Changes

🔍 Inspect the changes: https://github.com/HealthBioscienceIDEAS/microscopy-novice/compare/md-outputs..md-outputs-PR-99

The following changes were observed in the rendered markdown documents:

 fig/shapes-histogram.png (new)  | Bin 0 -> 6045 bytes
 fig/shapes-thresholds.png (new) | Bin 0 -> 289934 bytes
 fig/shapes.png (new)            | Bin 0 -> 33012 bytes
 filters-and-thresholding.md     |  48 +++++++++++++++-------------------------
 md5sum.txt                      |   2 +-
 5 files changed, 19 insertions(+), 31 deletions(-)
What does this mean?

If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible.

This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation.

⏱️ Updated at 2025-11-21 07:30:27 +0000

github-actions bot pushed a commit that referenced this pull request Nov 10, 2025
github-actions bot pushed a commit that referenced this pull request Nov 10, 2025
@K-Meech K-Meech self-requested a review November 13, 2025 11:07
Copy link
Contributor

@K-Meech K-Meech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @stellaprins - this looks great! I agree this change makes the differences between the thresholding methods clearer + the otsu explanation less confusing.

I've put a couple of very minor comments below:

Co-authored-by: Kimberly Meechan <[email protected]>
github-actions bot pushed a commit that referenced this pull request Nov 18, 2025
github-actions bot pushed a commit that referenced this pull request Nov 19, 2025
@stellaprins stellaprins requested a review from K-Meech November 19, 2025 11:10
Copy link
Contributor

@K-Meech K-Meech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @stellaprins - looking great!
Could you possibly put the mask images into a grid (e.g. around 2 per line), rather than all in one line? Now there are 5, they end up quite small in the final rendered site, so it's a bit hard to see the differences. No worries if this is hard to change!

github-actions bot pushed a commit that referenced this pull request Nov 19, 2025
@stellaprins
Copy link
Contributor Author

Yes, good call! What do you think of 3 per line (and including the original) as I've done now?

Happy to change it to 2 per line :)

Copy link
Contributor

@K-Meech K-Meech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @stellaprins - really like the new grid layout! Much easier to see the images 😄

I noticed one final part that needs to be updated in the text (the order of the peaks in the first exercise), but otherwise this is ready to merge.

@stellaprins stellaprins requested a review from K-Meech November 21, 2025 07:29
github-actions bot pushed a commit that referenced this pull request Nov 21, 2025
Copy link
Contributor

@K-Meech K-Meech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @stellaprins - I'll merge this now 🎉

@K-Meech K-Meech merged commit ec1da21 into HealthBioscienceIDEAS:main Nov 21, 2025
4 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 21, 2025
Auto-generated via `{sandpaper}`
Source  : ec1da21
Branch  : main
Author  : Kimberly Meechan <[email protected]>
Time    : 2025-11-21 09:10:04 +0000
Message : Merge pull request #99 from stellaprins/sp/otsu

Change shapes image
github-actions bot pushed a commit that referenced this pull request Nov 21, 2025
Auto-generated via `{sandpaper}`
Source  : 1439450
Branch  : md-outputs
Author  : GitHub Actions <[email protected]>
Time    : 2025-11-21 09:10:54 +0000
Message : markdown source builds

Auto-generated via `{sandpaper}`
Source  : ec1da21
Branch  : main
Author  : Kimberly Meechan <[email protected]>
Time    : 2025-11-21 09:10:04 +0000
Message : Merge pull request #99 from stellaprins/sp/otsu

Change shapes image
github-actions bot pushed a commit that referenced this pull request Nov 25, 2025
Auto-generated via `{sandpaper}`
Source  : 1439450
Branch  : md-outputs
Author  : GitHub Actions <[email protected]>
Time    : 2025-11-21 09:10:54 +0000
Message : markdown source builds

Auto-generated via `{sandpaper}`
Source  : ec1da21
Branch  : main
Author  : Kimberly Meechan <[email protected]>
Time    : 2025-11-21 09:10:04 +0000
Message : Merge pull request #99 from stellaprins/sp/otsu

Change shapes image
github-actions bot pushed a commit that referenced this pull request Dec 2, 2025
Auto-generated via `{sandpaper}`
Source  : 1439450
Branch  : md-outputs
Author  : GitHub Actions <[email protected]>
Time    : 2025-11-21 09:10:54 +0000
Message : markdown source builds

Auto-generated via `{sandpaper}`
Source  : ec1da21
Branch  : main
Author  : Kimberly Meechan <[email protected]>
Time    : 2025-11-21 09:10:04 +0000
Message : Merge pull request #99 from stellaprins/sp/otsu

Change shapes image
github-actions bot pushed a commit that referenced this pull request Dec 9, 2025
Auto-generated via `{sandpaper}`
Source  : 1439450
Branch  : md-outputs
Author  : GitHub Actions <[email protected]>
Time    : 2025-11-21 09:10:54 +0000
Message : markdown source builds

Auto-generated via `{sandpaper}`
Source  : ec1da21
Branch  : main
Author  : Kimberly Meechan <[email protected]>
Time    : 2025-11-21 09:10:04 +0000
Message : Merge pull request #99 from stellaprins/sp/otsu

Change shapes image
github-actions bot pushed a commit that referenced this pull request Dec 16, 2025
Auto-generated via `{sandpaper}`
Source  : 1439450
Branch  : md-outputs
Author  : GitHub Actions <[email protected]>
Time    : 2025-11-21 09:10:54 +0000
Message : markdown source builds

Auto-generated via `{sandpaper}`
Source  : ec1da21
Branch  : main
Author  : Kimberly Meechan <[email protected]>
Time    : 2025-11-21 09:10:04 +0000
Message : Merge pull request #99 from stellaprins/sp/otsu

Change shapes image
github-actions bot pushed a commit that referenced this pull request Dec 23, 2025
Auto-generated via `{sandpaper}`
Source  : 1439450
Branch  : md-outputs
Author  : GitHub Actions <[email protected]>
Time    : 2025-11-21 09:10:54 +0000
Message : markdown source builds

Auto-generated via `{sandpaper}`
Source  : ec1da21
Branch  : main
Author  : Kimberly Meechan <[email protected]>
Time    : 2025-11-21 09:10:04 +0000
Message : Merge pull request #99 from stellaprins/sp/otsu

Change shapes image
github-actions bot pushed a commit that referenced this pull request Dec 30, 2025
Auto-generated via `{sandpaper}`
Source  : 1439450
Branch  : md-outputs
Author  : GitHub Actions <[email protected]>
Time    : 2025-11-21 09:10:54 +0000
Message : markdown source builds

Auto-generated via `{sandpaper}`
Source  : ec1da21
Branch  : main
Author  : Kimberly Meechan <[email protected]>
Time    : 2025-11-21 09:10:04 +0000
Message : Merge pull request #99 from stellaprins/sp/otsu

Change shapes image
github-actions bot pushed a commit that referenced this pull request Jan 6, 2026
Auto-generated via `{sandpaper}`
Source  : 1439450
Branch  : md-outputs
Author  : GitHub Actions <[email protected]>
Time    : 2025-11-21 09:10:54 +0000
Message : markdown source builds

Auto-generated via `{sandpaper}`
Source  : ec1da21
Branch  : main
Author  : Kimberly Meechan <[email protected]>
Time    : 2025-11-21 09:10:04 +0000
Message : Merge pull request #99 from stellaprins/sp/otsu

Change shapes image
github-actions bot pushed a commit that referenced this pull request Jan 20, 2026
Auto-generated via `{sandpaper}`
Source  : 1439450
Branch  : md-outputs
Author  : GitHub Actions <[email protected]>
Time    : 2025-11-21 09:10:54 +0000
Message : markdown source builds

Auto-generated via `{sandpaper}`
Source  : ec1da21
Branch  : main
Author  : Kimberly Meechan <[email protected]>
Time    : 2025-11-21 09:10:04 +0000
Message : Merge pull request #99 from stellaprins/sp/otsu

Change shapes image
github-actions bot pushed a commit that referenced this pull request Jan 27, 2026
Auto-generated via `{sandpaper}`
Source  : 1439450
Branch  : md-outputs
Author  : GitHub Actions <[email protected]>
Time    : 2025-11-21 09:10:54 +0000
Message : markdown source builds

Auto-generated via `{sandpaper}`
Source  : ec1da21
Branch  : main
Author  : Kimberly Meechan <[email protected]>
Time    : 2025-11-21 09:10:04 +0000
Message : Merge pull request #99 from stellaprins/sp/otsu

Change shapes image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Otsu only suitable for bimodal histograms

2 participants